package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ArTableFiledRelationMapper;
import com.ruoyi.system.domain.ArTableFiledRelation;
import com.ruoyi.system.service.IArTableFiledRelationService;

/**
 * 关系字段信息Service业务层处理
 * 
 * @author ruoyi_ln
 * @date 2022-03-01
 */
@Service
public class ArTableFiledRelationServiceImpl implements IArTableFiledRelationService 
{
    @Autowired
    private ArTableFiledRelationMapper arTableFiledRelationMapper;

    /**
     * 查询关系字段信息
     * 
     * @param recNo 关系字段信息ID
     * @return 关系字段信息
     */
    @Override
    public ArTableFiledRelation selectArTableFiledRelationById(String recNo)
    {
        return arTableFiledRelationMapper.selectArTableFiledRelationById(recNo);
    }

    /**
     * 查询关系字段信息列表
     * 
     * @param arTableFiledRelation 关系字段信息
     * @return 关系字段信息
     */
    @Override
    public List<ArTableFiledRelation> selectArTableFiledRelationList(ArTableFiledRelation arTableFiledRelation)
    {
        return arTableFiledRelationMapper.selectArTableFiledRelationList(arTableFiledRelation);
    }

    /**
     * 新增关系字段信息
     * 
     * @param arTableFiledRelation 关系字段信息
     * @return 结果
     */
    @Override
    public int insertArTableFiledRelation(ArTableFiledRelation arTableFiledRelation)
    {
        arTableFiledRelation.setRecNo(UUID.randomUUIDPlus());
        arTableFiledRelation.setCreateTime(DateUtils.getNowDate());
        arTableFiledRelation.setCreateBy(SecurityUtils.getUsername());
        arTableFiledRelation.setDelFlag("0");
        return arTableFiledRelationMapper.insertArTableFiledRelation(arTableFiledRelation);
    }

    /**
     * 修改关系字段信息
     * 
     * @param arTableFiledRelation 关系字段信息
     * @return 结果
     */
    @Override
    public int updateArTableFiledRelation(ArTableFiledRelation arTableFiledRelation)
    {
        arTableFiledRelation.setUpdateTime(DateUtils.getNowDate());
        arTableFiledRelation.setUpdateBy(SecurityUtils.getUsername());
        return arTableFiledRelationMapper.updateArTableFiledRelation(arTableFiledRelation);
    }

    /**
     * 批量删除关系字段信息
     * 
     * @param recNos 需要删除的关系字段信息ID
     * @return 结果
     */
    @Override
    public int deleteArTableFiledRelationByIds(String[] recNos)
    {
        return arTableFiledRelationMapper.deleteArTableFiledRelationByIds(recNos);
    }

    /**
     * 删除关系字段信息信息
     * 
     * @param recNo 关系字段信息ID
     * @return 结果
     */
    @Override
    public int deleteArTableFiledRelationById(String recNo)
    {
        return arTableFiledRelationMapper.deleteArTableFiledRelationById(recNo);
    }

    @Override
    public ArTableFiledRelation selectArTableFiledRelationByTableId(String recNo) {
        return arTableFiledRelationMapper.selectArTableFiledRelationByTableId(recNo);
    }
}
